package service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.AttentionDao;
import dao.AttentionMapper;
import pojo.Attention;
import pojo.Page;

@Service
public class AttentionServiceImpl implements AttentionServiceI {

	@Autowired
	private AttentionDao attentionDao;
	@Autowired
	private AttentionMapper aMapper;
	@Override
	public List<Integer> FindAttentionUser(Integer userId, Page page) {
		// TODO Auto-generated method stub
		return attentionDao.SelectByUserId(userId,page);
	}

	@Override
	public Integer FindAttentionUserCount(Integer userId) {
		return attentionDao.SelectByUserIdCount(userId);
	}

	@Override
	public int insertAttention(Attention attention) {
		// TODO Auto-generated method stub
		return aMapper.insertSelective(attention);
	}

	@Override
	public int FindAttentionOrNot(Integer user1Id, Integer user2Id) {
		// TODO Auto-generated method stub
		return attentionDao.selectAttentionOrNot(user1Id, user2Id);
	}
	@Override
	public int UpdateAttention(Integer user1Id, Integer user2Id,Integer ltof) {
		// TODO Auto-generated method stub
		return attentionDao.updateAttention(user1Id, user2Id,ltof);
	}
	@Override
	public Attention FindAttentionByUser(Integer user1Id, Integer user2Id) {
		// TODO Auto-generated method stub
		return attentionDao.selectByUser(user1Id, user2Id);
	}

}
